package com.example.demo.dao;

import com.example.demo.model.Article;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface ArticleMapper {
    int insert(Article row);

    int insertSelective(Article row);

    Article selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(Article row);

    int updateByPrimaryKeyWithBLOBs(Article row);

    int updateByPrimaryKey(Article row);

    //查询所有帖子列表
    List<Article> selectAll();

    //查询指定板块的帖子列表
    List<Article> selectByBoardId(Long id);

    //查看帖子详情
    Article selectDetailById(Long id);


    List<Article> selectByUserId (@Param("userId") Long userId);

}